#设置cmake最低版本
cmake_minimum_required(VERSION 3.4.1)

#设置项目名称
project(tst_qtbase_auto_integration_gui)

#引入add_module模板文件
include(${ISSQTTESTROOTDIR}/cmake/add_module.cmake)

#设置测试类型，auto为自动测试，manual为手动测试,即test目录下的文件夹名
set(TEST_TYPE auto)
#设置模块名
set(MODULE qtbase)
#设置需要链接的模块
set(LinkQt Core Gui Widgets Network Concurrent OpenGL Sql Svg Quick Xml PrintSupport)
#设置需要链接的模块的私有模块
set(LinkQtPrivate Core Test Gui Widgets Sql Network OpenGL Concurrent PrintSupport)


add_definitions("-DQT_DISABLE_DEPRECATED_BEFORE=0"
                "-DSRCDIR=\"${CMAKE_CURRENT_SOURCE_DIR}/\"")
get_filename_component(CMAKE_NATIVE_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM} NAME)
add_definitions(-DDEFAULT_MAKESPEC="${CMAKE_NATIVE_MAKE_PROGRAM}")


set(CodeRootPath ${ISSQTTESTROOTDIR}/qtbase)
include_directories(${CodeRootPath}/3rdparty/tinycbor/src
                    ${CodeRootPath}/3rdparty/tinycbor/tests
                    ${CodeRootPath}/3rdparty/tinycbor/tests/encoder
                    ${CodeRootPath}/3rdparty/tinycbor/tests/parser
                    ${CodeRootPath}/tests/auto/other/qvariant_common
                    ${CodeRootPath}/tests/auto/corelib/kernel/qcoreapplication
                    ${CodeRootPath}/tests/baselineserver/shared
                    ${CodeRootPath}/tests/
                    ${CodeRootPath}/tests/auto/other/qabstractitemmodelutils
                    ${CodeRootPath}/tests/shared
                    ${CodeRootPath}/tests/auto/corelib/kernel/qmetatype)

#多级目录
set(TEST_ITEMS ${TEST_ITEMS}
	other/qabstractitemmodelutils
)

add_sources(
    /corelib/kernel/qdeadlinetimer/tst_qdeadlinetimer.cpp
    /corelib/kernel/qelapsedtimer/tst_qelapsedtimer.cpp
    /corelib/kernel/qmath/tst_qmath.cpp
    /corelib/kernel/qmetaenum/tst_qmetaenum.cpp
    /corelib/kernel/qmetamethod/tst_qmetamethod.cpp
    /corelib/kernel/qmimedata/tst_qmimedata.cpp
    /corelib/kernel/qsignalblocker/tst_qsignalblocker.cpp
    /corelib/kernel/qsignalmapper/tst_qsignalmapper.cpp
    /corelib/tools/qlist/tst_qlist.cpp
    /corelib/serialization/qdatastream/tst_qdatastream.cpp
    /corelib/serialization/qdatastream/testdata.qrc
    /corelib/kernel/qeventloop/tst_qeventloop.cpp
    /corelib/kernel/qmetaobject/tst_qmetaobject.cpp
    /corelib/kernel/qtimer/tst_qtimer.cpp
    /corelib/kernel/qtranslator/tst_qtranslator.cpp
    /corelib/kernel/qtranslator/qtranslator.qrc
    /corelib/kernel/qsystemsemaphore/tst_qsystemsemaphore.cpp

    #todo
#    /corelib/kernel/qobject/tst_qobject.cpp                             #probably caused by NULL pointer dereference
#    /corelib/kernel/qmetaproperty/tst_qmetaproperty.cpp                 #probably caused by NULL pointer dereference
)

#0为使用widget_main，1为使用gui_main,2使用core_main,3使用appless_main，4或其他使用none_main
set(MANUAL_ADD_MAIN 1)

set(PLUGINS QOpenHarmonyPlatformIntegrationPlugin)
#再把TEST_ITEMS传给create_library整合测试项，生成测试库
#整合测试项，生成测试库，名字当前工程名，即project(tst_qtcharts_auto)中定义的tst_qtcharts_auto
create_library(${TEST_ITEMS})

